using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class ManufacturersofVaccinescodeMVXAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public ManufacturersofVaccinescodeMVXAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v23] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v231] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v24] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v25] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v251] = HL7TableType.HL7;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v23] = new string[]{"AB","AD","ALP","AR","BA","BAY","BP","CON","EVN","GRE","IM","IUS","JPN","KGC","LED","MA","MIL","MIP","MSD","NAB","NYB","OTC","OTH","PD","PRX","SCL","SI","SKB","UNK","WA"};
						validVersionCodes[HL7Version.v231] = new string[]{"AB","AD","ALP","AR","AVI","BA","BAY","BP","BPC","CEN","CHI","CON","EVN","GRE","IAG","IM","IUS","JPN","KGC","LED","MA","MED","MIL","MIP","MSD","NAB","NYB","NAV","NOV","OTC","ORT","PD","PMC","PRX","SCL","SI","SKB","USA","WA","WAL","OTH","UNK"};
						validVersionCodes[HL7Version.v24] = new string[]{"AB","AD","ALP","AR","AVI","BA","BAY","BP","BPC","CEN","CHI","CON","EVN","GRE","IAG","IM","IUS","JPN","KGC","LED","MA","MED","MIL","MIP","MSD","NAB","NYB","NAV","NOV","OTC","ORT","PD","PMC","PRX","SCL","SI","SKB","USA","WA","WAL","OTH","UNK"};
						validVersionCodes[HL7Version.v25] = new string[]{"AB","AD","ALP","AR","AVB","AVI","BA","BAH","BAY","BP","BPC","CEN","CHI","CMP","CON","EVN","GRE","IAG","IM","IUS","JPN","KGC","LED","MA","MBL","MED","MIL","MIP","MSD","NAB","NAV","NOV","NYB","ORT","OTC","OTH","PD","PMC","PRX","PWJ","SCL","SI","SKB","UNK","USA","WA","WAL"};
						validVersionCodes[HL7Version.v251] = new string[]{"AB","AD","ALP","AR","AVB","AVI","BA","BAH","BAY","BP","BPC","CEN","CHI","CMP","CON","EVN","GRE","IAG","IM","IUS","JPN","KGC","LED","MA","MBL","MED","MIL","MIP","MSD","NAB","NAV","NOV","NYB","ORT","OTC","OTH","PD","PMC","PRX","PWJ","SCL","SI","SKB","UNK","USA","WA","WAL"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v23] = new string[]{"Abbott","Adams","Alpha","Armour","Baxter","Bayer","Berna","Connaught","Evans","Greer","Merieux","Immuno-US","Microbial Dis/Osaka U","Korea Green Cross","Lederle","Massachusetts Public Health","Miles","Michigan Dept Public Health","Merck","North American Biologicals, Inc.","New York Blood Center","Organon Teknika","Other","Parke Davis","Praxis Biologics","Sclavo","Swiss Serum and Vaccine Inst.","SmithKline","Unknown manufacturer","Wyeth-Ayerst"};
						validVersionDescriptions[HL7Version.v231] = new string[]{"Abbott Laboratories","Adams Laboratories","Alpha Therapeutic Corporation","Armour (Inactive – use CEN)","Aviron","Baxter Healthcare Corporation","Bayer Corporation (includes Miles, Inc. and Cutter Laboratories)","Berna Products (Inactive – use BPC)","Berna Products Corporation (includes Swiss Serum and Vaccine Institute Berna)","Centeon L.L.C. (includes Armour Pharmaceutical Company)","Chiron Corporation","Connaught (inactive – use PMC)","Evans Medical Limited","Greer Laboratories, Inc.","Immuno International AG","Merieux (inactive – Use PMC)","Immuno-US, Inc.","The Research Foundation for Microbial Diseases of Osaka University (BIKEN)","Korea Green Cross Corporation","Lederle (inactive – use WAL)","Massachusetts Public Health Biologic Laboratories)","Medimmune, Inc.","Miles (inactive – use BAY)","Michigan Biologic Products Institute","Merck & Co., Inc.","NABI (formerly North American Biologicals, Inc.)","New York Blood Center","North American Vaccine, Inc.","Novartis Pharmaceutical Corporation","Organon Teknika Corporation","Ortho Diagnostic Systems, Inc.","Parkdale Pharmaceuticals (formerly Parke-Davis)","Pasteur Merieux Connaught (includes Connaught Laboratories and Pasteur Merieux)","Praxis Biologics (inactive – use WAL)","Sclavo, Inc.","Swiss Serum and Vaccine Inst. (inactive – use BPC)","SmithKline Beecham","United States Army Medical Research and Materiel Command","Wyeth-Ayerst (inactive – use WAL)","Wyeth-Ayerst (includes Wyeth-Lederle Vaccines and Pediatrics, Wyeth Laboratories, Lederle Laboratories, and Praxis Biologics)","Other","Unknown manufacturer"};
						validVersionDescriptions[HL7Version.v24] = new string[]{"Abbott Laboratories (includes Ross Products Division)","Adams Laboratories","Alpha Therapeutic Corporation","Armour [Inactive-use CEN]","Aviron","Baxter Healthcare Corporation","Bayer Corporation(includes Miles, Inc. and Cutter Laboratories)","Berna Products [Inactive-use BPC]","Berna Products Corporation (includes Swiss Serum and Vaccine Institute Berne)","Centeon L.L.C. (includes Armour Pharmaceutical Company)","Chiron Corporation","Connaught [Inactive-use PMC]","Evans Medical Limited (an affiliate of Medeva Pharmaceuticals, Inc.)","Greer Laboratories, Inc.","Immuno International AG","Merieux [Inactive-use PMC]","Immuno-U.S., Inc.","The Research Foundation for Microbial Diseases of Osaka University (BIKEN)","Korea Green Cross Corporation","Lederle [Inactive-use WAL]","Massachusetts Public Health Biologic Laboratories","MedImmune, Inc.","Miles [Inactive-use BAY]","Bioport Corporation (formerly Michigan Biologic Products Institute)","Merck & Co., Inc.","NABI (formerly North American Biologicals, Inc.)","New York Blood Center","North American Vaccine, Inc.","Novartis Pharmaceutical Corporation (includes Ciba-Geigy Limited and Sandoz Limited)","Organon Teknika Corporation","Ortho Diagnostic Systems, Inc.","Parkedale Pharmaceuticals (formerly Parke-Davis)","Aventis Pasteur Inc. (formerly Pasteur Merieux Connaught; includes Connaught Laboratories and Pasteur Merieux)","Praxis Biologics [Inactive-use WAL]","Sclavo, Inc.","Swiss Serum and Vaccine Inst. [Inactive-use BPC]","SmithKline Beecham","United States Army Medical Research and Materiel Command","Wyeth-Ayerst [Inactive-use WAL]","Wyeth-Ayerst (includes Wyeth-Lederle Vaccines and Pediatrics, Wyeth Laboratories, Lederle Laboratories, and Praxis Biologics)","Other manufacturer","Unknown manufacturer"};
						validVersionDescriptions[HL7Version.v25] = new string[]{"Abbott Laboratories","Adams Laboratories, Inc.","Alpha Therapeutic Corporation","Armour","Aventis Behring L.L.C.","Aviron","Baxter Healthcare Coporation]","Baxter Health Corporation","Bayer Corporation","Berna Products","Berna Products Corporation","Centeon L.L.C.","Chiron Corporation","Celltech Medeva Pharmaceuticals","Connaught","Evans Medical Limited","Greer Laboratories, Inc.","Immuno International AG","Merieux","Immuno-U.S., Inc.","The Research Foundation for Microbial Diseases of Osaka University","Korea Green Cross Corporation","Lederle","Massachusetts Public Health Biologic Laboratories","Massachusetts Biologic Laboratories","MedImmune, Inc.","Miles","Bioport Corporation","Merck & Co., Inc.","NABI","North American Vaccine, Inc.","Novartis Pharmaceutical Corporation","New York Blood Center","Ortho-Clinical Diagnostics.","Organon Teknika Corporation","Other manufacturer","Parkedale Pharmaceuticals","Aventis Pasteur Inc.","Praxis Biologics","PowerJect Pharamaceuticals","Sclavo, Inc.","Swiss Serum and Vaccine Inst.","GlaxoSmithKline","Unknown manufacturer","United States Army Medical Research and Material Command","Wyeth-Ayerst","Wyeth-Ayerst"};
						validVersionDescriptions[HL7Version.v251] = new string[]{"Abbott Laboratories","Adams Laboratories, Inc.","Alpha Therapeutic Corporation","Armour","Aventis Behring L.L.C.","Aviron","Baxter Healthcare Coporation]","Baxter Health Corporation","Bayer Corporation","Berna Products","Berna Products Corporation","Centeon L.L.C.","Chiron Corporation","Celltech Medeva Pharmaceuticals","Connaught","Evans Medical Limited","Greer Laboratories, Inc.","Immuno International AG","Merieux","Immuno-U.S., Inc.","The Research Foundation for Microbial Diseases of Osaka University","Korea Green Cross Corporation","Lederle","Massachusetts Public Health Biologic Laboratories","Massachusetts Biologic Laboratories","MedImmune, Inc.","Miles","Bioport Corporation","Merck & Co., Inc.","NABI","North American Vaccine, Inc.","Novartis Pharmaceutical Corporation","New York Blood Center","Ortho-Clinical Diagnostics.","Organon Teknika Corporation","Other manufacturer","Parkedale Pharmaceuticals","Aventis Pasteur Inc.","Praxis Biologics","PowerJect Pharamaceuticals","Sclavo, Inc.","Swiss Serum and Vaccine Inst.","GlaxoSmithKline","Unknown manufacturer","United States Army Medical Research and Material Command","Wyeth-Ayerst","Wyeth-Ayerst"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
